﻿@model IEnumerable<KRM.Core.vWebViewReturn>
@{
    ViewBag.Title = "Returns";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


<div class="container-fluid">
    <fieldset>
        <legend>Search</legend>
        <form action="/rdm/returns" class="row-fluid">
            <div class="span1">Order Ref</div>
            <div class="span2">
                <input type="text" name="orderref" class="input-block-level" value="@(Request["orderref"] ?? "")"/>
            </div>
            <div class="span1">RDM</div>
            <div class="span2">
                <input type="text" name="rdm" class="input-block-level" value="@(Request["rdm"] ?? "")"/>
            </div>
            <div class="span2 text-right">Filter displayed results</div>
            <div class="span3">
                @Html.DropDownList("StatusId", null, new { @class = "input-block-level", onchange="this.form.submit()" })
            </div>
            <div class="span1">
                <input type="submit" class="btn btn-primary" value="Search" />
            </div>
        </form>
    </fieldset>
    <p>
        <input type="checkbox" disabled="disabled" checked="checked" style="float: left; margin-right: 10px;" />
        Restrict to top 100
    </p>
    
    <table class="table table-bordered table-fix tbl-selected krmtable" data-height="200">
        <thead>
            <tr>
                <th>RDM Number</th>
                <th>OrderRef</th>
                <th>Order Item</th>
                <th>Collection Date</th>
                <th>Carrier Name</th>
                <th>Action</th>
                <th>Postcode</th>
                <th>Loadcode</th>
                <th>PlannedDeliveryDate</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr style="cursor: pointer; @(item.Urgent == true ? "color:red;" : "")" onclick="returnselected('@item.DisputeID')">
                    <td>@item.RDMNumber</td>
                    <td>@item.OrderRef</td>
                    <td>@item.OrderItem</td>
                    <td>@item.CollectionDate</td>
                    <td>@item.carrierName</td>
                    <td>@item.Action</td>
                    <td>@item.Postcode</td>
                    <td></td>
                    <td></td>
                </tr>
            }
        </tbody>
    </table>
    @Html.Partial("Partial/Rdm/_EditPhoto")
    <div class="return-details">
        <div class="row-fluid">
            <div class="span5">
                <div class="border-padding10">
                    <div class="row-fluid">
                        <div class="span4">Order Item</div>
                        <div class="span8">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span4">Collection Date</div>
                        <div class="span8">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span4">Collection Items</div>
                        <div class="span8">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span4">Collection Fee</div>
                        <div class="span8">
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span4">Parcels Expected</div>
                        <div class="span2">
                            <input type="text" class="input-block-level" />
                        </div>
                        <div class="span4">Parcels Received</div>
                        <div class="span2">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                    <div class="row-fluid">
                        <div class="span4">Reason for Return</div>
                        <div class="span8">
                            <input type="text" class="input-block-level" />
                        </div>
                    </div>
                </div>
            </div>

            <div class="span7">
                <div class="border-padding10" style="height: 230px; overflow: auto">
                    <table class="table table-bordered table-fix table-hover">
                        <thead>
                            <tr>
                                <th>Name</th>
                                <th>Description</th>
                            </tr>
                        </thead>
                        <tbody>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <fieldset>
            <legend>Parcel list</legend>
            <div style="height: 150px; overflow: auto">
                <table class="table table-bordered table-fix tbl-selected">
                    <thead>
                        <tr>
                            <th>Date Received</th>
                            <th>NumberOfParcels</th>
                            <th>Parcels Contents</th>
                            <th>Condition</th>
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>
        </fieldset>


    </div>

    <fieldset>
        <legend>Parcel information</legend>
        <form action="/rdm/saveparcel" method="POST" class="fr-parcel">
            <div class="row-fluid">
                <div class="span5">
                    <div class="border-padding10">
                        <div class="row-fluid">
                            <div class="span4">Date Received</div>
                            <div class="span8">
                                <input type="text" class="input-block-level" />
                            </div>
                        </div>
                        <div class="row-fluid">
                            <div class="span4">Number of Parcels</div>
                            <div class="span8">
                                <input type="text" class="input-block-level" />
                            </div>
                        </div>
                        <div class="row-fluid">
                            <div class="span4">Parcels Contents</div>
                            <div class="span8">
                                <input type="text" class="input-block-level" />
                            </div>
                        </div>
                        <div class="row-fluid">
                            <div class="span4">Condition</div>
                            <div class="span8">
                                <input type="text" class="input-block-level" />
                            </div>
                        </div>
                        <div class="row-fluid">
                            <div class="span4">Liability(if damaged)</div>
                            <div class="span8">
                                <input type="text" class="input-block-level" />
                            </div>
                        </div>
                    </div>
                </div>

                <div class="span7">
                    <div class="border-padding10">
                        Condition Description
                        <textarea class="input-block-level" rows="8"></textarea>
                    </div>

                </div>
            </div>
            <div class="border-padding10 text-right">
            <button type="submit" class="btn btn-primary btn-saveparcel">Save</button>
        </div>
        </form>
    </fieldset>
</div>
